Skip to content

feat(sandbox): let a subagent's space carry environment directories - #762

Merged
lexoliu merged 2 commits into
mainfrom
feat/subagent-space-env
Nov 12, 2026
Merged

lexoliu merged 2 commits into
mainfrom
feat/subagent-space-env

Conversation

@lexoliu

@lexoliu lexoliu commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Closes #761.

PreparedSpace::with_env_dir(name, path) records a variable naming a directory inside the space; confine refuses one outside it, as it does working copies. launch_resolved hands the prepared variables to the subagent's sandbox as a space layer that derived resets, so a nested subagent carries only its own. The host backend applies the layer after the sandbox environment and EnvSource and before a spec's variables; the container backend exports it between the source's and the spec's, each path as the container sees it through the workspace mount.

Tests cover the layer order on the host, the container exports through the mount, a path outside the space failing the launch, and an end-to-end subagent (host and recording container) seeing its own directories while a nested one sees only its own.

@lexoliu lexoliu closed this Nov 11, 2026
@lexoliu lexoliu reopened this Nov 11, 2026
@lexoliu
lexoliu added this pull request to the merge queue Nov 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 12, 2026
@lexoliu
lexoliu added this pull request to the merge queue Nov 12, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 12, 2026
@lexoliu
lexoliu added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 7f6878a Nov 12, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A subagent's space cannot carry environment for its commands

1 participant